package com.sky.utils;

import org.mindrot.jbcrypt.BCrypt;

/**
 * ClassName: PasswordUtil
 * Package: com.sky.utils
 * Description:
 *
 * @Author 八云
 * @Create 2025/3/16 16:37
 * @Version 1.0
 */
public class BCryptUtil {
    // 加密密码
    public static String hashPassword(String plainTextPassword) {
        return BCrypt.hashpw(plainTextPassword, BCrypt.gensalt());
    }

    // 验证密码
    public static boolean checkPassword(String plainTextPassword, String hashedPassword) {
        return BCrypt.checkpw(plainTextPassword, hashedPassword);
    }
}
